Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 3 - Printer Drivers


Writing Printer Driver Files

After you know which messages you need to override as part of managing certain printing tasks, you need to write your printer driver in three kinds of files:

The content of each of these file types is reviewed in this section, with sample code from the ImageWriter II printer driver included. The complete contents of the ImageWriter II driver files are found in the QuickDraw GX sample code.

Each driver must include one or more assembly-language jump tables, one or more files of code (in assembly-language, C, Pascal, or some other language) to write the functions that the driver performs, and one or more resource files. The ImageWriter II printer driver consists of the files shown in Table 3-1.
Table 3-1 Files used to implement the ImageWriter II printer driver
FilenameContents
CommonDefines.hThe header file containing values and types used in other files
ChooserSupport.aThe assembly-language defines for working with the Chooser-related resources
ChooserSupport.cThe code for the resources used by the Chooser
ChooserSupport.rThe resources needed for the driver to work with
the Chooser
newapp.aThe jump table for the overrides provided in the newapp.c module
newapp.cThe implementations of the QuickDraw GX printing messages that this driver overrides
newapp.rThe resources needed for the QuickDraw GX printing messages
oldapp.aThe jump table for the overrides provideded in the oldapp.c module
oldapp.cThe implementations of message overrides for compatibility with the Macintosh Printing Manager
oldapp.rThe resources needed for the Macintosh Printing Manager compatibility messages

This section describes the contents of several of these files. The complete files are found in the QuickDraw GX sample code.

The ImageWriter II printer driver is divided into two portions:

You can develop your printer driver in any number of files. Some developers find it convenient to separate the Macintosh Printing Manager compatibility portion of the code from the QuickDraw GX printing message portion, while others use different criteria to decide which code goes in which file.


Subtopics
Message Overrides and the Jump Table
The Message Overrides
Using the Printing-Related Collections

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help